
/*
    功能 ：页面基本布局控制代码
	bruce.lee
	2017.12.14
*/
function pageInit() {
		//loadheader
		$("#header").load("header.html");
		$("#header1").load("../header.html");
		//loadfooter
		$("#footer").load("footer.html");
		$("#footer1").load("../footer.html");

		var wHeight = $(window).height();
		var rHeight = $("#right").height();
		//var menuHeight =  (rHeight > wHeight) ? rHeight - 70 : wHeight - 110;
		//var menuHeight =  (rHeight > wHeight) ? rHeight : wHeight-110;
		var menuHeight;
		//alert("w"+wHeight + "--r" + rHeight);
		if(rHeight>wHeight){
			menuHeight = rHeight;
		 //alert(menuHeight);
		}else if(wHeight-110 < rHeight){
			menuHeight = rHeight;
		}else{
			menuHeight=wHeight-110;
		}
		//alert(menuHeight);
		$("#leftmenu").css({'height':menuHeight});
		//alert(0);
	}
$(function(){
	//初始化页面元素
	pageInit();

	//resizefunction
	$(window).resize(function() {pageInit();});
})
//加载combobox
function LoadDDL(ddl, type) {
    var option = {
        type: "POST",
		url: '../Common/loadDDL',
		data: {Flag:type},
        success: function (data) {
			if(data){
				$("#" + ddl).combobox("loadData", data);
			}
        }
    };
    $.ajax(option);
}

//加载conbotree
function LoadDTree(ddl, type) {
    var option = {
        type: "POST",
		url: '../Common/loadtree',
		data: {Flag:type},
        success: function (data) {
			if(data){
				$("#" + ddl).combotree("loadData", data);
			}
        }
    };
    $.ajax(option);
}
